// 异步更新
var asyn = function(that, tip, param){
	layer.confirm(tip,{
		skin: 'layui-layer-molv',
		btn: ['确定','取消']
	},function(){
		$.post(ctx + "/banner/" + that.attr("data-id") + "/asyn", param, function(data){
			if(data.result_code=='SUC'){
				window.location.reload();
			}else{
				layer.msg("操作失败，请刷新重试！");
			}
		})
	});
};

$(function(){
	
	// 停用
	$(".disable-link").click(function(){
		var that = $(this);
		asyn(that, '是否停用?请确定！', {status:0});
	});
	
	// 启用
	$(".enable-link").click(function(){
		var that = $(this);
		asyn(that, '是否启用?请确定！', {status:1});
	});
});